/*
 * This class allows each module to draw on the screen, implementing
 * the simpliest methods for drawing on the screen. Implementation is platform-dependent
 * UI uses the only method - getDrawable. 
 * For example, in Android it looks like (Bitmap)IDrawer.getDrawable().draw(); 
 */

package org.amse.ys.sndeditor.model;

import org.amse.ys.sndeditor.model.drawer.RequestBoolean;
import org.amse.ys.sndeditor.model.drawer.RequestString;

public abstract class IDrawer {
	// this class should be initilized only once, from the editor
	protected IDrawer() {
	};

	public static IDrawer getDrawer() {
		return null;
	};

	public static IDrawer getDrawer(Object context) {
		return null;
	};

	public abstract void setSize(int x, int y); // sets size of drawable area

	public abstract void drawCircle(int x, int y, int radius); // draws circle

	public abstract Object getDrawable(); // the method nessesary for UI

	public abstract void drawText(String text, int x, int y); // prints string

	public abstract void setColor(int alpha, int r, int g, int b); // sets
																	// active
																	// color for
																	// drawing

	public abstract void drawLine(int x0, int y0, int x1, int y1); // draws line

	public abstract void fastDrawLine(int x0, int y0, int x1, int y1, int color); // draws
																					// line

	public abstract void drawRectangle(int left, int top, int right, int bottom); // draws
																					// rectangle

	public abstract void drawPoint(int x, int y); // draws the only point

	public abstract boolean isChanged(); // indicates, whether drawable area has
											// changed

	// since the last check. AFTER CHECK, THIS METHOD SHOULD BE SET FALSE.
	public abstract int measureTextHeight(String s);

	public abstract int measureTextWidth(String s);

	// Dialogs

	// USER - interactions
	public abstract void saveFileDialog(RequestString action);

	public abstract void showMessage(String message);

	public abstract void showMessageWithCheckbox(String message,
			String checkboxMessage, RequestBoolean action);

	public abstract void showProgressDialog(String title, String message);

	public abstract void showBooleanRequest(String question,
			RequestBoolean action);

	public abstract void hideProgressDialog();

	// drawing bitmaps
	public abstract void drawPicture(int id, int x, int y);

	public abstract int getPictureWidth(int id);

	public abstract int getPictureHeight(int id);

	public abstract void saveBackgroud();

	public abstract void drawBackground();
}